
#include "server.h"
int main(int argc, char *argv[])
{
    int fd_s = tcp_init("0", 8888, 50);
    ERROR_CHECK(fd_s, -1, "tcp_init");
    int epfd = epoll_create(1);
    struct epoll_event event,ready_events[50];
    event.events =EPOLLIN;
    event.data.fd = fd_s;
    int ret = epoll_ctl(epfd,EPOLL_CTL_ADD,fd_s,&event);
    ERROR_CHECK(-1,ret,"epoll_ctl");
    sqlite3* db = NULL;
    int ret = sqlite3_open("server.db",&db);
    ERROR_CHECK_SQL(ret,0,"open",db);
    char create_table ="create table if not exists userinfo(uname char(32) PRIMARY KEY,upasswd char(32))";
    ret = sqlite3_exec(db,create_table,NULL,NULL,NULL);
    ERROR_CHECK_SQL(ret,0,"sql_create_table",db);
    
    while (1)
    {
        /* code */
    }
    
    return 0;
}
